import 'package:flutter/material.dart';

/**
 * ListView.builder
 */
class ListWidget02 extends StatelessWidget {
  const ListWidget02({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Color(0xffff0000),
        title: Text('ListView.build'),
      ),
      body: ListView.builder(
        itemCount: 20,
        itemBuilder: (BuildContext context, int index) {
          ///Container BoxDecoration实现分割线
          return Container(
            decoration: BoxDecoration(
              border: Border(top: BorderSide(color: Colors.green)),
            ),
            child: Text(
              'dddddd$index',
              style: TextStyle(fontSize: 20),
            ),
          );
        },
      ),
    );
  }
}
